package com.yuliang.controller;


import com.aliyuncs.exceptions.ClientException;
import com.yuliang.domain.R;
import com.yuliang.service.UploadService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@Api(description = "文件上传相关接口")
public class UploadController {

    @Autowired
    private UploadService uploadService;

    @PostMapping("/upload")
    public R upload(MultipartFile img) throws ClientException {
        return uploadService.uploadImg(img);
    }
}
